<?php
    $userID = $_GET['userID'];
    $materialID = $_GET['materialID'];
    require('db_connection.php');

    $sql3 = "DELETE FROM tblcirculation WHERE materialID = '$materialID' AND userID = '$userID' AND status='reserved'";

    $result3 = mysql_query($sql3);
    if($result3)
    {
        echo"<script> alert('Reservation cancelled!');</script>";
        echo"'<script>document.location.href='account.php'</script>'";
    }
    else
    {
      echo "Delete failed";
    }

?>
